<?php

namespace common\models\cms;

use Yii;

/**
 * This is the model class for table "{{%cms_article_stats}}".
 *
 * @property int $id
 * @property int $article_id 文章ID
 * @property int $views 浏览次数
 * @property int $likes 点赞数
 * @property int $comments 评论数
 * @property int $created_at
 * @property int $updated_at
 */
class CmsArticleStats extends \common\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%cms_article_stats}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['article_id', 'views', 'likes', 'comments', 'created_at', 'updated_at'], 'integer'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'article_id' => '文章ID',
            'views' => '浏览次数',
            'likes' => '点赞数',
            'comments' => '评论数',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

    /**
     * 统计信息基础数据结构
     * {@inheritdoc}
     */
    public function fields() {
        return [
            'views',
            'likes',
            'comments',
        ];
    }

}
